package com.test.io.buffer.obj;

import java.io.Serializable;

/**
 * @version 1.0
 * @Author: 许啸林
 * @Date: 2021/6/3 14:48
 */
public class Dog implements Serializable {
    /**
     * 序列化版本号 可以提高兼容性
     */
    private static final long serialVersionUID = 1L;
    private String dogName;
    /**
     * 序列化类的所有对象都需要实现序列化接口，否则会报错
      */
    private Master master;
    private int dogAge;
    /**
     *  static treansient 不可被序列化
     */
    public static String nation;
    private transient  String color;
    public String getDogName() {
        return dogName;
    }

    public void setDogName(String dogName) {
        this.dogName = dogName;
    }

    public int getDogAge() {
        return dogAge;
    }

    public void setDogAge(int dogAge) {
        this.dogAge = dogAge;
    }

    public Master getMaster() {
        return master;
    }

    public void setMaster(Master master) {
        this.master = master;
    }

    public Dog() {
    }

    public Dog(String dogName, int dogAge, String nation ,String color, Master master) {
        this.dogName = dogName;
        this.dogAge = dogAge;
        this.color = color;
        Dog.nation = nation;
        this.master = master;
    }

    public Dog(String dogName, int dogAge, String color) {
        this.dogName = dogName;
        this.dogAge = dogAge;
        this.color = color;
    }

    @Override
    public String toString() {
        return "Dog{" +
                "dogName='" + dogName + '\'' +
                ", dogAge=" + dogAge +
                ", nation=" + nation +
                ", color='" + color + '\'' +
                '}';
    }
}
